 {extend name="foxcms" /}

{block name="css"}
{/block}

{block name="body"}



<div class="foxcms-content-inner">
    <!-- page content -->
    <div class="basic-set-content">
        <div class="section section-panel">
            <input name="bcid" value="{$bcid}" type="hidden"/>
            <input name="id" value="{$basic.id}" type="hidden"/>
            <div class="section-title">网站状态</div>
            <div class="section-main">
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label class="foxui-required">网站状态：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-radio-group status">
                                <div class="foxui-radio {if ($base.status) == 1} is-checked {/if}">
                                    <span class="foxui-radio-input">
                                        <i class="foxui-radio-icon"></i>
                                        <input type="radio" value="1" name="status"/>
                                    </span>
                                    <span class="foxui-radio-label">启用</span>
                                </div>
                                <div class="foxui-radio {if ($base.status) == 0} is-checked {/if}">
                                    <span class="foxui-radio-input">
                                        <i class="foxui-radio-icon"></i>
                                        <input type="radio" value="0"/>
                                    </span>
                                    <span class="foxui-radio-label" name="status">禁用</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="input-box-sub">
                        <div class="foxui-textarea">
                            <textarea id="status_desc" maxlength="60" autocomplete="off" rows="2" placeholder="网站升级维护中，预计下周一恢复"name="status_desc">{$base.status_desc}</textarea>
                            <span class="foxui-textarea-count">0/60</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="section-title margin-top-46">后台路径</div>
            <div class="section-main">
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label>后台管理路径：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-input-prepend">
                                <div class="foxui-prepend-inner is-grey">{$domain}</div>
                                <input placeholder="请输入网址" required value="{$admin_path}" name="admin_path" />
                            </div>
                        </div>
                        <div style="font-size:16px; border: 1px solid #dcdfe6; height: 40px;line-height: 40px;border-radius:  0 4px 4px 0;padding: 0 10px;color: #909399;background-color: #f2f6fc;">.php</div>
                    </div>
                </div>
            </div>

            <div class="section-title margin-top-46">网站设置</div>
            <div class="section-main">

                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label class="foxui-required">站点根网址：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-input-prepend">
                                <div class="foxui-prepend-inner">
                                    <div class="foxui-select">
                                        <div class="foxui-select-handle foxui-select-icon">
                                            <input name="url_prefix" class="foxui-select-input" readonly="readonly" value="{$basic.url_prefix|default='http://'}"/>
                                        </div>
                                        <div class="foxui-select-menu">
                                            <ul class="foxui-select-slide">
                                                <li class="foxui-select-item" data-id="1">http://</li>
                                                <li class="foxui-select-item" data-id="2">https://</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <input class="foxui-size-small" placeholder="请输入网站地址" required value="{$basic.url}" name="url"/>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.url_call}</span>
                    </div>
                </div>

                {if $templateType == 2 || $templateType == 3}
                <div class="section-main-item">
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.mobile_domain_call}</span>
                    </div>
                </div>
                {/if}

                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label class="foxui-required">网站名称：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-input-suffix">
                                <input class="foxui-size-small" maxlength="15" placeholder="请输入网站名称" value="{$basic.name}" name="name"/>
                                <i class="foxui-suffix-icon foxui-suffix-count">0/15</i>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.name_call}</span>
                    </div>
                </div>
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label class="foxui-required">首页标题：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-input-suffix">
                                <input class="foxui-size-small" maxlength="30" placeholder="请输入首页标题" value="{$basic.title}" name="title"/>
                                <i class="foxui-suffix-icon foxui-suffix-count">0/30</i>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.title_call}</span>
                    </div>
                </div>
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label class="foxui-required">首页关键词：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-input-suffix">
                                <input class="foxui-size-small" maxlength="50" placeholder="请输入首页关键词" value="{$basic.keyword}" name="keyword"/>
                                <i class="foxui-suffix-icon foxui-suffix-count">0/15</i>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.keyword_call}</span>
                    </div>
                </div>
                <div class="section-main-item">
                    <div class="foxui-input-group foxui-align-items-start">
                        <div class="input-label">
                            <label>站点描述：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-textarea">
                                <textarea autocomplete="off" rows="2" placeholder="请输入站点描述"name="description">{$basic.description}</textarea>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.description_call}</span>
                    </div>
                </div>
                <!--<div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label>网站默认风格：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-select">
                                <div class="foxui-select-handle foxui-select-icon">
                                    <input class="foxui-select-input foxui-size-small" readonly="readonly" placeholder="请选择网站风格（不选则为默认）" value="{$basic.default_style}" name="default_style"/>
                                    <i class="foxui-icon-close-circle"></i>
                                </div>
                                <div class="foxui-select-menu">
                                    <ul class="foxui-select-slide">
                                        <li class="foxui-select-item" data-id="1">default</li>
                                        <li class="foxui-select-item" data-id="2">simplicity</li>
                                        <li class="foxui-select-item" data-id="3">fashion</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.default_style_call}</span>
                    </div>
                </div>-->
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label>主页连接：</label>
                        </div>
                        <div class="input-box">
                            <input class="foxui-size-small" placeholder="请输入主页地址" required value="{$basic.homepage_url}" name="homepage_url"/>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.homepage_url_call}</span>
                    </div>
                </div>
                <div class="section-main-item foxui-images-fluid">
                    <div class="foxui-input-group foxui-align-items-start">
                        <div class="input-label">
                            <label>网站LOGO：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-images foxui-images-fluid">
                                <div class="foxui-images-card web_logo">
                                    <ul class="foxui-images-list">
                                        {if $basic.web_logo != ""}
                                        <li class="foxui-images-item foxui-animate-fadeInDown">
                                            <div class="content">
                                                <img src="{$basic.web_logo}" />
                                                <span class="replace">替换</span>
                                                <i class="foxui-icon-cuowu-f delete"></i>
                                            </div>
                                        </li>
                                        {/if}
                                        <div class="foxui-images-handle">
                                            <div class="foxui-images-handle-inner">
                                                <i class="foxui-icon-jiahao-o"></i>
                                                <span class="text">添加图片</span>
                                            </div>
                                        </div>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <p class="input-box-info">
                        LOGO尺寸比例建议根据前端网站模板的LOGO制作，避免造成错位或变形
                    </p>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.web_logo_call}</span>
                    </div>
                </div>
                <div class="section-main-item">
                    <div class="foxui-input-group foxui-align-items-start">
                        <div class="input-label">
                            <label>URL图标：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-images">
                                <div class="foxui-images-card web_icon">
                                    <ul class="foxui-images-list">
                                        {if $basic.web_icon != ""}
                                        <li class="foxui-images-item foxui-animate-fadeInDown">
                                            <div class="content">
                                                <img src="{$basic.web_icon}" />
                                                <span class="replace">替换</span>
                                                <i class="foxui-icon-cuowu-f delete"></i>
                                            </div>
                                        </li>
                                        {/if}
                                        <div class="foxui-images-handle">
                                            <div class="foxui-images-handle-inner">
                                                <i class="foxui-icon-jiahao-o"></i>
                                                <span class="text">添加图片</span>
                                            </div>
                                        </div>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <p class="input-box-info">
                        浏览器地址栏Favicon图标
                        <span class="example" id="faviconExample" style="margin-left: -12px;"><i class="foxui-icon-wenti-o"></i>示例</span>
                    </p>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.web_icon_call}</span>
                    </div>
                </div>
                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label>文档HTML保存路径：</label>
                        </div>
                        <div class="input-box">
                            <input class="foxui-size-small" placeholder="请输入路径" value="{$basic.html_save_path}" name="html_save_path"/>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.html_save_path_call}</span>
                    </div>
                </div>

                <div class="section-main-item">
                    <div class="foxui-input-group foxui-align-items-start">
                        <div class="input-label">
                            <label>网站版权信息：</label>
                        </div>
                        <div class="input-box">
                            <div class="foxui-textarea">
                                <textarea autocomplete="off" rows="2" placeholder="请输入版板信息"name="copyright">{$basic.copyright}</textarea>
                            </div>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.copyright_call}</span>
                    </div>
                </div>

                <div class="section-main-item">
                    <div class="foxui-input-group">
                        <div class="input-label">
                            <label>网站备案号：</label>
                        </div>
                        <div class="input-box">
                            <input class="foxui-size-small" placeholder="请输入网站备案号"value="{$basic.aq}" name="aq"/>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.aq_call}</span>
                    </div>
                </div>

                <div class="section-main-item foxui-images-fluid">
                    <div class="foxui-input-group foxui-align-items-start">
                        <div class="input-label">
                            <label>公安备案号：</label>
                        </div>
                        <div class="input-box">
                            <input class="foxui-size-small" placeholder="请输入公安备案号"value="{$basic.police_aq}" name="police_aq"/>
                        </div>
                    </div>
                    <div class="call-field">
                        <span class="foxui-tag foxui-light-info">{$basic.police_aq_call}</span>
                    </div>
                    <p class="input-box-info">
                        根据国内相关法规，网站完成工信部ICP备案后，通常需要进行公安备案 <a href="//www.foxcms.cn/help/problem/gonganbeian/10.html" target="_blank"><i class="foxui-icon-wenti-o"></i>操作指南</a>
                    </p>
                </div>

                <!--动态标签start-->
                <div class="field">
                    <?php echo variateFieldTag("basic", $id); ?>
                </div>
                <!--动态标签end-->

                <div class="foxui-tabs-header foxui-margin-bottom-24" style="height:28px;"></div>
            </div>
        </div>
    </div>
</div>

<div class="foxcms-content-footer">
    <button class="is-long foxui-size-small foxui-solid-primary" id="save">保存</button>
</div>

{include file="footed-copy"/}
{/block}


{block name="js"}

<script>
    foxui.confirmtip({
        el: '#faviconExample',
        content: `<img src="/static/images/favicon.png"/>`,
        trigger: 'hover',
        placement:['top','center']
    });
</script>

<script>

    //面包屑
    let bcid = $("input[name='bcid']").val();


    //保存
    $('#save').click(function () {

        //状态
        let status = $('.status .foxui-radio.is-checked input').val();
        //状态描述
        let status_desc = $('#status_desc').val();
        //站点根网址
        let url_prefix = $('input[name="url_prefix"]').val();
        //网站地址
        let url = $('input[name="url"]').val();
        //手机域名
        let mobile_domain = $('input[name="mobile_domain"]').val();
        //管理员用户名
        let name = $('input[name="name"]').val();

        //网站风格
        let default_style = $('input[name="default_style"]').val();
        //主页连接
        let homepage_url = $('input[name="homepage_url"]').val();
        //网站logo
        let web_logo = $('.web_logo img').attr('src');
        //网站后台logo
        // let login_logo = $('.login_logo img').attr('src');
        //浏览器地址栏Favicon图标
        let web_icon = $('.web_icon img').attr('src');
        //文档HTML保存路径
        let html_save_path = $('input[name="html_save_path"]').val();
        //网站版权信息
        let copyright = $('textarea[name="copyright"]').val();
        //站点描述
        let description = $('textarea[name="description"]').val();
        //首页标题
        let title = $('input[name="title"]').val();
        //关键字
        let keyword = $('input[name="keyword"]').val();
        //网站备案号
        let aq = $('input[name="aq"]').val();
        let police_aq = $('input[name="police_aq"]').val();

        let id = $('input[name="id"]').val();
        //后台路径
        let admin_path = $('input[name="admin_path"]').val();
        //版权标识
        let copyright_mark = $('.copyright_mark .foxui-radio.is-checked input').val();
        let copyright_remove_mark = $('div[data-name="copyright_remove_mark"]').hasClass('is-checked')?1:0;
        let copyright_color = $('input[name="copyright_color"]').val();

        let datas = {
            'status': status, "status_desc": status_desc, "url": url, "name": name, "title": title, "keyword": keyword,
            "default_style": default_style, "homepage_url": homepage_url, "web_logo": web_logo||"",
            "web_icon": web_icon||"", "html_save_path": html_save_path, "copyright": copyright,"mobile_domain":mobile_domain,
            "description": description, "aq": aq, "id": id, "url_prefix": url_prefix, "admin_path": admin_path,police_aq,
            copyright_mark,copyright_remove_mark,copyright_color
        };

        //拉取会员属性
        let feildUrl = "{:url('Variate/getField')}?group=basic";
        let saveData = getField($(".field"), feildUrl);
        let curData = Object.assign(datas, saveData);

        foxui.dialog({
            title: '保存',
            content: '您确定要保存吗',
            cancelText: '取消',
            confirmText: '保存',
            confirm: function (callback) {
                ajaxR('{:url("Config/save")}', "post", curData, {},function (res) {
                    if (res.code == 1) {
                        if (res.data == "") {
                            foxui.message({
                                type: 'success',
                                text: res.msg
                            })
                            setTimeout('myrefresh()', 1000); //指定10秒刷新一次
                        } else {
                            window.location.href = "/" + res.data;
                        }
                    } else {
                        foxui.message({
                            type: 'warning',
                            text: res.msg
                        })
                    }
                }, function (res) {
                    foxui.message({
                        type: 'warning',
                        text: res.msg
                    })
                })
                callback();
            },
            cancel: function () {
                foxui.message({
                    type: 'warning',
                    text: '取消操作'
                })
            },
        });

    })

</script>

{/block}

